3.189 \(\int \cot ^3(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=34 \[ -\frac{(a-b) \log (\sin (e+f x))}{f}-\frac{a \cot ^2(e+f x)}{2 f} \]

[Out]

-(a*Cot[e + f*x]^2)/(2*f) - ((a - b)*Log[Sin[e + f*x]])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0322388, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3629, 12, 3475} \[ -\frac{(a-b) \log (\sin (e+f x))}{f}-\frac{a \cot ^2(e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^3*(a + b*Tan[e + f*x]^2),x]

[Out]

-(a*Cot[e + f*x]^2)/(2*f) - ((a - b)*Log[Sin[e + f*x]])/f

Rule 3629

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
((A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
 NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac{a \cot ^2(e+f x)}{2 f}-\int (a-b) \cot (e+f x) \, dx\\ &=-\frac{a \cot ^2(e+f x)}{2 f}-(a-b) \int \cot (e+f x) \, dx\\ &=-\frac{a \cot ^2(e+f x)}{2 f}-\frac{(a-b) \log (\sin (e+f x))}{f}\\ \end{align*}

Mathematica [A]  time = 0.148674, size = 56, normalized size = 1.65 \[ \frac{b (\log (\tan (e+f x))+\log (\cos (e+f x)))}{f}-\frac{a \left (\cot ^2(e+f x)+2 \log (\tan (e+f x))+2 \log (\cos (e+f x))\right )}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^3*(a + b*Tan[e + f*x]^2),x]

[Out]

(b*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/f - (a*(Cot[e + f*x]^2 + 2*Log[Cos[e + f*x]] + 2*Log[Tan[e + f*x]]
))/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.044, size = 41, normalized size = 1.2 \begin{align*}{\frac{b\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{ \left ( \cot \left ( fx+e \right ) \right ) ^{2}a}{2\,f}}-{\frac{a\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^3*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*b*ln(sin(f*x+e))-1/2*a*cot(f*x+e)^2/f-a*ln(sin(f*x+e))/f

________________________________________________________________________________________

Maxima [A]  time = 1.04715, size = 42, normalized size = 1.24 \begin{align*} -\frac{{\left (a - b\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{a}{\sin \left (f x + e\right )^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*((a - b)*log(sin(f*x + e)^2) + a/sin(f*x + e)^2)/f

________________________________________________________________________________________

Fricas [A]  time = 1.08583, size = 154, normalized size = 4.53 \begin{align*} -\frac{{\left (a - b\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + a \tan \left (f x + e\right )^{2} + a}{2 \, f \tan \left (f x + e\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*((a - b)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1))*tan(f*x + e)^2 + a*tan(f*x + e)^2 + a)/(f*tan(f*x + e)^
2)

________________________________________________________________________________________

Sympy [A]  time = 2.68415, size = 100, normalized size = 2.94 \begin{align*} \begin{cases} \tilde{\infty } a x & \text{for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \cot ^{3}{\left (e \right )} & \text{for}\: f = 0 \\\frac{a \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac{a \log{\left (\tan{\left (e + f x \right )} \right )}}{f} - \frac{a}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac{b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{b \log{\left (\tan{\left (e + f x \right )} \right )}}{f} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**3*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*a*x, (Eq(e, 0) | Eq(e, -f*x)) & (Eq(f, 0) | Eq(e, -f*x))), (x*(a + b*tan(e)**2)*cot(e)**3, Eq(f
, 0)), (a*log(tan(e + f*x)**2 + 1)/(2*f) - a*log(tan(e + f*x))/f - a/(2*f*tan(e + f*x)**2) - b*log(tan(e + f*x
)**2 + 1)/(2*f) + b*log(tan(e + f*x))/f, True))

________________________________________________________________________________________

Giac [B]  time = 1.3396, size = 215, normalized size = 6.32 \begin{align*} \frac{8 \,{\left (a - b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right ) - 4 \,{\left (a - b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{{\left (a + \frac{4 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}}{\cos \left (f x + e\right ) - 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}}{8 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/8*(8*(a - b)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1) - 4*(a - b)*log(-(cos(f*x + e) - 1)/(cos(f*x +
e) + 1)) + (a + 4*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1))*(cos(f*
x + e) + 1)/(cos(f*x + e) - 1) + a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/f